package com.example.aigc_education.enums;

import lombok.Getter;

@Getter
public enum UserGenderType {

    FEMALE_TYPE("女",0),
    MALE_TYPE("男",1);

    private final String title;
    private final Integer value;

    UserGenderType(String title, Integer value) {
        this.title = title;
        this.value = value;
    }

    public static UserGenderType fromValue(Integer value) {
        for (UserGenderType genderType : UserGenderType.values()) {
            if (genderType.getValue().equals(value)) {
                return genderType;
            }
        }
        throw new IllegalArgumentException("No enum constant with value " + value);
    }
}
